<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // JSON 对象
        //   parse()  把字符串转成对象
        //   stringify()  把对象变成字符串

        const obj = {
            name : 'aa' , 
            age : 15 ,
            pwd : '123'
        }

        const res = JSON.stringify(obj) ;
        console.log(res);


        const str = '{"name" : "aa" , "age" : "16" , "pwd" : "123"}' ;

        const obj2 = JSON.parse(str) ;

        console.log(obj2);

    </script>
    
</body>
</html>